home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / os.722 < prev    next >
Text File  |  1992-02-06  |  3KB  |  66 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Courier;\f2\fswiss Helvetica;}
  2. \paperw11440
  3. \paperh9000
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ul0\fs28 kgdb kl_ld loadable kernel server breakpoints\
  8. \
  9. Q:  When I run kgdb on my loadable kernel server, the slave system doesn't stop at the breakpoints I've set.   What am I doing wrong?  \
  10. \
  11. Q:  The symbols in my kernel server seem to have addresses that are relative to the origin of the kernel server, not the origin of the kernel.   What am I doing wrong?   Are these related?\
  12. \
  13. A:  When you compile a kernel server with kl_ld, it produces a 
  14. \b relocatable
  15. \b0  object module.     This  module has not been linked against the kernel, and the addresses of its symbols start at 0.  When you invoke kl_util -a, it edits the server's links against the currently running kernel,  and produces a 
  16. \b loadable
  17. \b0  module, with addresses that reflect its actual location in the kernel.   \
  18. \
  19. Normally, the loadable module is simply loaded into the kernel, and not copied into the file system.    However, if you  invoke kl_ld with the 
  20. \b -d 
  21. \b0 option,  then when you later execute kl_util -a, the loader will leave behind a copy of the loadable object file (-d option in bold face below):\
  22. \
  23.         \
  24.     
  25. \f1 mysystem% kl_ld -n myserver -l Load_commands -u \\\
  26.         Unload_Commands -i instance_variables \\\
  27.         
  28. \b -d  myserver_loadable
  29. \b0  \\\
  30.         -o myserver_reloc \\\
  31.         myserver_object_file.o other_object.o\
  32.     mysystem% ls *reloc *loadable\
  33.         
  34. \i myserver_reloc
  35. \i0  \
  36.     mysystem%\
  37.     \
  38.     \
  39.     mysystem% kl_util -a myserver_reloc\
  40.     mysystem% ls *reloc *loadable\
  41.         
  42. \i myserver_reloc myserver_loadable
  43. \i0 \
  44.     mysystem%\
  45.  
  46. \f0 \
  47. \
  48. (Note that
  49. \fc0  you must specify the _loadable suffix as part of <name>.   The system doesn't do that for you.)\
  50. \
  51. It is the _loadable module against which you must execute kgdb, not the _reloc object.\
  52. \
  53. If you run kgdb against the relocatable module, or against the wrong loadable module, the addresses seen by kgdb will be incorrect, and breakpoints will not work.\
  54. \
  55. If you have any question as to whether the module your using is the right one, you can look at its addresses with the nm command, and compare them to the addresses of the same symbols in the kernel you're debugging.   They should be the same.\
  56.  
  57. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 \
  58.  
  59. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520 \
  60. QA722\
  61.     \
  62. Not valid for 1.0\
  63. Valid for 2.0\
  64. \
  65.  
  66.